﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using System.Windows.Media;
using System.Windows.Controls;
using System.Windows;
using AppToolkit.WPF.Primitives.Arrows;

namespace WPFExtensionsTests.Primitives.Arrows
{
    [TestFixture]
    public class ArrowLineTests
    {
        [Test, RequiresSTA]
        public void ArrowLine_Tests()
        {
            Canvas canv = new Canvas();

            // ArrowLine with animated arrow properties.
            ArrowLine aline1 = new ArrowLine();
            aline1.Stroke = Brushes.Red;
            aline1.StrokeThickness = 3;
            aline1.X1 = 100;
            aline1.Y1 = 400;
            aline1.X2 = 400;
            aline1.Y2 = 100;
            canv.Children.Add(aline1);
            

            // ArrowPolyline rotated.            
            ArrowPolyline apoly = new ArrowPolyline();
            
            apoly.ArrowEnds = ArrowEnds.Both;
            apoly.Stroke = Brushes.Green;
            apoly.StrokeThickness = 3;

            apoly.Points.Add(new Point(25, 25));
            apoly.Points.Add(new Point(125, 25));
            apoly.Points.Add(new Point(125, 125));
            apoly.Points.Add(new Point(25, 125));

            canv.Children.Add(apoly);
        }

        [Test, RequiresSTA]
        public void ArrowPolyLine_Tests()
        {
            Canvas canv = new Canvas();

            // ArrowPolyline rotated.            
            ArrowPolyline apoly = new ArrowPolyline();
            RotateTransform xform = new RotateTransform();
            apoly.LayoutTransform = xform;
            apoly.ArrowEnds = ArrowEnds.Both;
            apoly.Stroke = Brushes.Green;
            apoly.StrokeThickness = 3;

            apoly.Points.Add(new Point(25, 25));
            apoly.Points.Add(new Point(125, 25));
            apoly.Points.Add(new Point(125, 125));
            apoly.Points.Add(new Point(25, 125));

            canv.Children.Add(apoly);
        }
    }
}
